package jp.co.sn.mml.pojo.tmitemhk;

import jp.co.sn.mml.pojo.tmsst.Tmsst;
import jp.co.sn.mml.pojo.tmitem.Tmitem;

public class TmitemhkId implements java.io.Serializable { 

	//コード区分
	private String cdKbn;
	//コード
	private Tmsst code;
	//項目コード
	private Tmitem itemCd;
	//材料系統区分
	private Long zrKtKbn;

	/** default constructor */
	public TmitemhkId(){

	}

	/** full constructor */
	public TmitemhkId(String cdKbn,Tmsst code,Tmitem itemCd
			,Long zrKtKbn){
		this.cdKbn = cdKbn;
		this.code = code;
		this.itemCd = itemCd;
		this.zrKtKbn = zrKtKbn;
	}

	//Property accessors
	public String getCdKbn(){
		return this.cdKbn;
	}

	public void setCdKbn(String cdKbn){
		this.cdKbn=cdKbn;
	}

	public Tmsst getCode(){
		return this.code;
	}

	public void setCode(Tmsst code){
		this.code=code;
	}

	public Tmitem getItemCd(){
		return this.itemCd;
	}

	public void setItemCd(Tmitem itemCd){
		this.itemCd=itemCd;
	}

	public Long getZrKtKbn(){
		return this.zrKtKbn;
	}

	public void setZrKtKbn(Long zrKtKbn){
		this.zrKtKbn=zrKtKbn;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof TmitemhkId))
			return false;

		TmitemhkId castOther = (TmitemhkId) other;

		return ((this.getCdKbn() ==  castOther.getCdKbn())
				||(this.getCdKbn()!=null && castOther.getCdKbn() !=null 
					&& castOther.getCdKbn() !=null 
					&& this.getCdKbn().equals(castOther.getCdKbn())))
			&& ((this.getCode() ==  castOther.getCode())
				||(this.getCode()!=null && castOther.getCode() !=null 
					&& castOther.getCode() !=null 
					&& this.getCode().equals(castOther.getCode())))
			&& ((this.getItemCd() ==  castOther.getItemCd())
				||(this.getItemCd()!=null && castOther.getItemCd() !=null 
					&& castOther.getItemCd() !=null 
					&& this.getItemCd().equals(castOther.getItemCd())))
			&& ((this.getZrKtKbn() ==  castOther.getZrKtKbn())
				||(this.getZrKtKbn()!=null && castOther.getZrKtKbn() !=null 
					&& castOther.getZrKtKbn() !=null 
					&& this.getZrKtKbn().equals(castOther.getZrKtKbn())))
;	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getCdKbn() == null ? 0 : this.getCdKbn().hashCode());
		result = 37 * result
				+ (getCode() == null ? 0 : this.getCode().hashCode());
		result = 37 * result
				+ (getItemCd() == null ? 0 : this.getItemCd().hashCode());
		result = 37 * result
				+ (getZrKtKbn() == null ? 0 : this.getZrKtKbn().hashCode());
		return result;
	}

}